<?php  namespace Home\Model;
use Hdphp\Model\Model;
class Address extends Model{
    protected $table = "user_address";
    //自动验证
    protected $validate = array(
        array('consignee','required','收货人不能为空',3,3),
        array('address','required','收货地址不能为空',3,3),
        array('mobile','required','手机号不能为空',3,3),
        array('mobile','phone','手机号输入不合要求',3,3)
    );
    //自动完成
    protected $auto = array(
        array('user_uid','user_uid','method',3,3)
    );
    //自动完成的方法
    public function user_uid(){
        return $_SESSION['uid'];
    }
    //添加
    public function store(){
        if(!$this->create()) return false;
        $this->add();
        return true;
    }














    
}





?>